package utils;

import com.mchange.v2.c3p0.ComboPooledDataSource;

import javax.sql.DataSource;
import java.sql.Connection;
import java.sql.SQLException;

/**
 * @Author admin
 * @Date 2019/2/25 10:32
 */
public class C3P0Utils {

    private static DataSource ds = null;

    static {
        ds = new ComboPooledDataSource("exam");
    }

    public static Connection getConnection() throws SQLException {
        return ds.getConnection();
    }

    public static DataSource getDateSourse(){
        return ds;
    }
}
